package com.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api-a")
public class ServiceAContoller {
	@GetMapping("/")
	public String index(HttpServletRequest request) {
		return "service a " + request.getLocalAddr() + ":" + request.getLocalPort();
	}

	@RequestMapping("/test")
	public String test(HttpServletRequest request) {
		return "service a test() " + request.getLocalAddr() + ":" + request.getLocalPort();
	}

	@GetMapping("/api")
	public String api(HttpServletRequest request) {
		return "service a api() " + request.getLocalAddr() + ":" + request.getLocalPort();
	}
}
